<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
			<meta name="renderer" content="webkit"> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="IE=9" http-equiv="X-UA-Compatible" />
		<link rel="stylesheet" href="/Public/css/reset.css" type="text/css" media="screen" />
		<link rel="stylesheet" href="/Public/css/style_content.css" type="text/css" media="screen" />
		<link href="/Public/css/uploadify.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" href="/Public/css/invalid.css" type="text/css" media="screen" />	
<script type="text/javascript" src="/Public/js/jquery-1.10.2.js"></script>
 <script type="text/javascript" src="/Public/js/jquery.uploadify.js"></script>		
 <script type="text/javascript" src="/Public/js/frame_js.js"></script>		
 <style>
.star{color:red;}
.uploadify-queue-item .cancel a {
	background: url('/Public/images/uploadify-cancel.png') 0 0 no-repeat;
}
</style>
	</head>

	<body>
		

		 <script type="text/javascript" charset="utf-8" src="/Public/js/ueditor.config.js"></script>
								    <script type="text/javascript" charset="utf-8" src="/Public/js/ueditor.all.min.js"> </script>
								    <script type="text/javascript" charset="utf-8" src="/Public/js/lang/zh-cn/zh-cn.js"></script>
	<STYLE>
   .clear {  clear: both;   }
	.input_class{width:15px;height:10px;}
.num{margin: 0 5px 0 0;padding: 3px 6px;color: #57a000;text-decoration: none;border: 1px solid #ddd;-webkit-border-radius: 4px;border-radius: 4px;}
.current{margin: 0 5px 0 0;padding: 3px 6px;color: #57a000;text-decoration: none;border: 1px solid #ddd;-webkit-border-radius: 4px;border-radius: 4px;background: #469400 url('{/Public/images/}bg-button-green.gif') top left repeat-x !important;border-color: #459300 !important;color: #fff !important;}
	</STYLE>
	<div id="main-content"> 
			<div class="content-box" style="margin:0 auto;width:1000px;">
				<div class="content-box-header">
					<h3><?php echo ($cate['name']); ?>>
				<?php if(empty($data['title'])){echo '新增';}else{ echo $data['title'];}?>
					</h3>
					<div class="clear"></div>
				</div> <!-- End .content-box-header -->
				<div class="content-box-content">
					<div>
					<div class="notification attention png_bg"  >
							<a href="#" class="close"><img src="/Public/images/cross_grey_small.png" title="Close this notification" alt="close" /></a>
							<div >
								提示：<span class="star">&nbsp;&nbsp;*&nbsp;&nbsp;</span>为必填，其他选填！！
							</div>
						</div>
						<form action="/admin/WebSet/articleSave" method="post" id="article_add" >
							<input type="hidden"  name="id" value="<?php echo ($data['id']); ?>" />
							<fieldset> 
								<p>
										标题：<span class="star">*</span>&nbsp;<input class="text-input small-input not_null" type="text"  name="title" value="<?php echo ($data['title']); ?>" /> <span class="input-notification success png_bg">Successful message</span> <!-- Classes for input-notification: success, error, information, attention -->
								</p>
								<p>
									栏目：
									<select name="cate_id" >
										  <?php  $sum=0; $mod=$cate['model_id']; function str_num(){ global $sum; $str=""; for ($i=0;$i<$sum;$i++){ $str=$str."&nbsp;&nbsp;&nbsp;&nbsp;"; } if($sum!=0){ $str=$str."|—"; } return $str; } function cate_str($data,$cate_id,$mod){ global $sum; foreach ($data as $r){ ?>
										<option value="<?php echo $r['id']?>"   <?php if(is_array($r['son'])||$r['model_id']!=$mod){echo "disabled='disabled'";}?> <?php if($cate_id==$r['id']){?>selected="selected"<?php }?> ><?php echo str_num().$r['name']?></option>
										         <?php  if(is_array($r['son'])) { $sum++; cate_str($r['son'],$cate_id,$mod); $sum--; } } } ?>
										 <?php  $cateinfo= get_cateinfo(); cate_str($cateinfo,$cate['id'],$mod);?>         
									</select>
									 <span class="input-notification  png_bg"></span>
								</p>
								<p>
										时间：<span class="star">*</span>&nbsp;<input class="text-input small-input not_null datepicker" type="text"  name="p_date" value="<?php echo ($data['p_date']); ?>" /> <span class="input-notification success png_bg">Successful message</span> 
								<?php echo getJqDete();?>
								
								</p>
									<label><span class="star">*</span>&nbsp;内容：</label>        
								<script id="container" name="content" type="text/plain">
																<?php echo ($data['content']); ?>
									</script>
									<script type="text/javascript">
									  var editor = UE.getEditor('container');
									  editor.setHeight(300);
									</script>
								<p>
									<input class="button" type="button" value="保存"  id="tijiao" onclick="model_save();" />
								</p>
							</fieldset>
							<div class="clear"></div><!-- End .clear -->
						</form>
					</div> <!-- End #tab2 -->      
				</div> <!-- End .content-box-content -->
			</div> <!-- End .content-box -->
		</div> <!-- End #main-content -->
<script>
//提交表单
$(function(){
						//表单检查是否为空
						$(".not_null").blur(function(){
							var obj=$(this).find("+span");
								 if($(this).val()==""){
									 obj.removeClass("success");
									 obj.addClass("error");
									 obj.html("不能为空！");
									 $("#tijiao").attr("disabled","disabled"); 
								 } else{
									 obj.removeClass("error");
									 obj.addClass("success");
									 $("#tijiao").removeAttr("disabled"); 
								 }
						});
});

	  function model_save(){
	      $("#article_add").submit();
	    }
	    
</script>
	</body>
  
</html>